home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15090 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Question about C compiler
  5. Date: 16 Apr 1996 20:51 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <16APR199620514504@erich.triumf.ca>
  9. References: <1996Apr16.175344.6042@lafn.org>
  10. NNTP-Posting-Host: erich.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <1996Apr16.175344.6042@lafn.org>, av871@lafn.org (Karl Chen) writes...
  14. >    In C and C++ ,there is a way to allocate and dealloacte memory 
  15. >dynamically ( in C,using malloc() and free(),In C++,using new and delete)
  16. >..I heard from a book that some compiler do not delete the pointer after
  17. >deallocation,is this true?Why they don't do this ? What about Boland C++
  18. >? Can anyone give me a advice ?
  19.  
  20. free(ptr) does not change ptr, or the memory ptr points to - it just "marks"
  21. the memory as available for future malloc()s.
  22.  
  23. After you do free(ptr) you can (but shouldn't) access the "freed" memory,
  24. and the data previously stored in it, providing a later malloc() has not used
  25. the space.
  26.  
  27. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  28. Internet: bennett@triumf.ca         | of one another only when one can be
  29. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  30. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  31. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  32. or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
  33. or: http:://vancouver-webpages.com/peter/index.html
  34.  
  35.